home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_hutcontorch.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  108 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_HutConTorch.cog
  4. #
  5. # [SXC] [RKD] [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     entered
  13.     message     activated
  14.     message     startup
  15.     
  16.     thing       torch                //the thing you light
  17.     thing       flame    nolink        //flame, hidden at startup
  18.     thing        player    local
  19.     
  20.     sector      sec_NoBurn
  21.     sector      sec_Burn
  22.     
  23.     sound       burning=gen_torch_burnin_c.wav  local
  24.     sound       lite=gen_torchlitet_c.wav       local
  25.     
  26.     vector      minlite        local
  27.     vector      maxlite        local
  28.     
  29.     int         lit=0       local
  30.     int         burn_Chnl   local
  31.     int         burn_On=0   local
  32.     
  33.     # ** subroutine **
  34.     flex        lightIt        local
  35. end
  36.  
  37. # ========================================================================================
  38.  
  39. code
  40.  
  41. startup:
  42.  
  43.     player = GetLocalPlayerThing();
  44.     minlite = VectorSet(0.87, 0.55, 0.06);
  45.     maxlite = VectorSet(0.89, 0.64, 0.30);    
  46.     SetThingFlags(flame, 0x10);
  47.     SetThingLight(torch, '0.0 0.0 0.0', 0.3, 0.1);
  48.  
  49.     return;
  50.  
  51. # ========================================================================================
  52.  
  53. entered:
  54.  
  55.     # turn OFF burn sfx and light
  56.     if((GetSenderRef() == sec_NoBurn) && (lit == 1) && (burn_On == 1))
  57.     {
  58.         burn_On = 0;
  59.         StopSound(burn_Chnl, 0.5);
  60.         SetThingLight(torch, '0.0 0.0 0.0', 0.3, 0.5);
  61.     }
  62.     
  63.     # turn ON burn sfx and light
  64.     if((GetSenderRef() == sec_Burn) && (lit == 1) && (burn_On == 0))
  65.     {
  66.         burn_On = 1;
  67.         burn_Chnl = PlaySoundThing(burning, torch, 1.0, 10, 25, 0x0001);
  68.         SetThingLight(torch, minlite, 0.3, 0.5);
  69.     }
  70.  
  71.     return;
  72.  
  73. # ========================================================================================
  74.  
  75. activated:
  76.  
  77.     if (lit == 1) return;
  78.     
  79.     # light high
  80.     PlayMode(player, 61, 0);
  81.     Sleep(0.3);
  82.     
  83.     call lightIt;
  84.     
  85.     return;
  86.  
  87. # ========================================================================================
  88.  
  89. lightIt:
  90.  
  91.     lit = 1;
  92.     burn_On = 1;
  93.     
  94.     ClearThingFlags(flame, 0x10);
  95.     SetThingLight(torch, minlite, 0.3, 0.5);
  96.         
  97.     #Sleep(0.5);
  98.  
  99.     PlaySoundThing(lite, torch, 1, 10, 25, 0);
  100.     burn_Chnl = PlaySoundThing(burning, torch, 1, 10, 20, 1);
  101.     
  102.     return;
  103.  
  104. # ========================================================================================
  105.  
  106. end
  107.  
  108.